package homework.api02.homework_api01;

public class ReplaceAllDemo {
    public static void main(String[] args) {
        String str = "abc123efg456hiz";
        str = str.replaceAll("[0-9]+","#NUMBER#");
        System.out.println(str);

        //和谐用语
        String message = "你sb,gun吧!";
        String regex = "(sb|gun|sha)";
        message = message.replaceAll(regex,"***");
        System.out.println(message);
    }
}
